package com.gxa.controller;

import com.gxa.common.R;
import com.gxa.pojo.statistics.*;
import com.gxa.service.StatisticsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;

@Controller     //修饰整个类，描述Controller的作用
//在  http://localhost:8080/swagger-ui.html  地址中查看下面的效果
@Api(value = "数据统计",tags = "数据统计接口API")   //  value：代表代码级描述  tags：代表页面级描述
@RequestMapping(value = "/statistics/*")   //接口和前端传递数据方式
public class StatisticsController {
    @Autowired
    private StatisticsService statisticsService;

    @RequestMapping(value = "/comprehensiveData" , method = RequestMethod.GET)   //接口和前端传递数据方式
    @ApiOperation(value = "综合数据接口",notes = "不传递值",httpMethod = "GET", response = ComprehensiveData.class)  //swagger对方法的详细描述
    @ResponseBody   //响应json数据给前端
    //综合数据接口
    public R comprehensiveData(){
        ComprehensiveData comprehensiveData = new ComprehensiveData(43,5,6,6,1488);
        R r = new R(200,"请求成功",comprehensiveData);
        return r;
    }

    @RequestMapping(value = "/talentReserve" , method = RequestMethod.GET)   //接口和前端传递数据方式
    @ApiOperation(value = "人才储备接口",notes = "不传递值",httpMethod = "GET", response = TalentReserve.class)  //swagger对方法的详细描述
    @ResponseBody   //响应json数据给前端
    //人才储备接口
    public R talentReserve(){
        TalentReserve talentReserve = new TalentReserve(26,5,5,7);
        R r = new R(200,"请求成功",talentReserve);
        return r;
    }

    @RequestMapping(value = "/departmentStaff" , method = RequestMethod.GET)   //接口和前端传递数据方式
    @ApiOperation(value = "部门员工接口",notes = "不传递值",httpMethod = "GET", response = DepartmentStaff.class)  //swagger对方法的详细描述
    @ResponseBody   //响应json数据给前端
    //部门员工接口
    public R departmentStaff(){
        DepartmentStaff departmentStaff = new DepartmentStaff("事业部",188);
        DepartmentStaff departmentStaff2 = new DepartmentStaff("研发部",32);
        DepartmentStaff departmentStaff3 = new DepartmentStaff("管理部",6);
        List<DepartmentStaff> list = new ArrayList<DepartmentStaff>();
        list.add(departmentStaff);
        list.add(departmentStaff2);
        list.add(departmentStaff3);

        R r = new R(200,"请求成功",list);
        return r;
    }

    @RequestMapping(value = "/employeeBasic" , method = RequestMethod.GET)   //接口和前端传递数据方式
    @ApiOperation(value = "员工基本接口",notes = "不传递值",httpMethod = "GET", response = EmployeeBasic.class)  //swagger对方法的详细描述
    @ResponseBody   //响应json数据给前端
    //员工基本接口
    public R employeeBasic(){
        EmployeeBasic employeeBasic = new EmployeeBasic(1488,1487,1421,66,1);
        R r = new R(200,"请求成功",employeeBasic);
        return r;
    }

    @RequestMapping(value = "/employeeMonth" , method = RequestMethod.GET)   //接口和前端传递数据方式
    @ApiOperation(value = "员工月份接口",notes = "不传递值",httpMethod = "GET", response = EmployeeMonth.class)  //swagger对方法的详细描述
    @ResponseBody   //响应json数据给前端
    //员工月份接口
    public R employeeMonth(){
        EmployeeMonth employeeMonth = new EmployeeMonth(42,11,54,5,87,3,  19,1,23,10,54,0,  23,2,87,4,34,7,  34,6,12,8,22,9);
        R r = new R(200,"请求成功",employeeMonth);
        return r;
    }

    @RequestMapping(value = "/employeeSex" , method = RequestMethod.GET)   //接口和前端传递数据方式
    @ApiOperation(value = "员工性别接口",notes = "不传递值",httpMethod = "GET", response = R.class)  //swagger对方法的详细描述
    @ResponseBody   //响应json数据给前端
    //员工性别接口
    public R employeeSex(){
        EmployeeSex employeeSex = new EmployeeSex(788,700);
        R r = new R(200,"请求成功",employeeSex);
        return r;
    }

    @RequestMapping(value = "/jobStatus" , method = RequestMethod.GET)   //接口和前端传递数据方式
    @ApiOperation(value = "在职状态接口",notes = "不传递值",httpMethod = "GET", response = R.class)  //swagger对方法的详细描述
    @ResponseBody   //响应json数据给前端
    //在职状态接口
    public R  jobStatus(){
        EmployeeBasic employeeBasic = new EmployeeBasic(null,null,1421,66,null);
        R r = new R(200,"请求成功",employeeBasic);
        return r;
    }

    @RequestMapping(value = "/blackList" , method = RequestMethod.GET)   //接口和前端传递数据方式
    @ApiOperation(value = "黑名单接口",notes = "不传递值",httpMethod = "GET", response = R.class)  //swagger对方法的详细描述
    @ResponseBody   //响应json数据给前端
    //黑名单接口
    public R blackList(){
        EmployeeBasic employeeBasic = new EmployeeBasic(null,1487,null,null,1);
        R r = new R(200,"请求成功",employeeBasic);
        return r;
    }

}
